import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Recommend from "../views/Recommend.vue";
import Hot from "../views/Hot.vue";
import Search from "../views/Search.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect:"/home",
  },
  {
    path: "/home",
    name: "home",
    redirect:"/home/recommend",
    component: Home,
    children:[
      {
        path: "recommend",
        name: "recommend",
        component: Recommend,
      },
      {
        path: "hot",
        name: "hot",
        component: Hot,
      },
      {
        path: "search",
        name: "search",
        component: Search,
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
